#./projects/CameraTrans/Makefile
SOURCES = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp,%.o,$(notdir $(SOURCES)))
OBJSD = $(addprefix $(TMP_DIR)camera_trans/,$(OBJS))

INCLUDE = -I $(PWD)/thirdparty/libuv/include \
		  -I $(PWD)/common/utilc \
		  -I $(PWD)/common/util \
		  -I $(PWD)/common/mqclient \
          -I $(PWD)/uvmodules/uvlogplus \
		  -I /usr/local/include \
		  -I /usr/local/include/opencv4 \
		  -I /usr/local/python3/include/python3.7m \
		  -I /usr/local/python3/lib/python3.7/site-packages/numpy/core/include

all:chkdir camera_trans$(TAGTYPE)

chkdir:
	$(shell mkdir -p $(TMP_DIR)camera_trans/)

camera_trans_static:$(OBJS)
	$(GG) $(OBJSD) -o $(OUT_DIR)camera_trans -L $(OUT_DIR) -l:uvlogplus.a -l:mqclient.a -l:util.a -l:utilc.a -l:pugixml.a -l:cjson.a -l:librabbitmq.a -l:libuv.a \
	-L /usr/local/lib -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale -lswresample \
	-L /usr/local/lib64 -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui \
	-lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_videoio -lopencv_video \
	-L /usr/local/python3/lib/python3.7/site-packages/numpy/core/lib -lnpymath -L /usr/local/python3/lib -lpython3.7m \
	-lrt -lresolv -lssl -lcrypto -pthread -ldl
	
camera_trans_shared:$(OBJS)
	$(GG) $(OBJSD) -o $(OUT_DIR)camera_trans -L $(OUT_DIR) -l:util.so -l:utilc.so -l:mqclient.so -l:uvlogplus.so -l:pugixml.so -l:cjson.so -l:librabbitmq.so -l:libuv.so \
	-L /usr/local/lib -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale -lswresample \
	-L /usr/local/lib64 -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui \
	-lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_videoio -lopencv_video \
	-pthread -ldl

$(OBJS):%.o:%.cpp
	$(GG) $(INCLUDE) $(GFLAGS) -c $< -o $(TMP_DIR)camera_trans/$@

clean:
	rm -rf $(TMP_DIR)camera_trans/*.o